<template>
  <div class="home">
    <div class="discount1 discount">
      <div class="content">
        <img
          class="log fadeInUp animated-fast"
          src="../assets/imgs/log_03.png"
        />
        <div class="head fadeInUp animated-fast">
          <img
            style="height: 170px; width: 455px;"
            src="../assets/imgs/toubu1_03.jpg"
            alt=""
          >
          <span>我们在行动，你呢？</span>
        </div>
        <div class="title fadeInUp animated-fast">
          <span class="common">涵盖</span>
          <span class="common1">90%</span>
          <span class="common">常用重点</span>
          <span class="common1">优惠政策</span>
        </div>
        <div class="title2 fadeInUp animated-fast">
          <span class="common1">轻松</span>
          <span class="common">四步，</span>
          <span class="common1">找到</span>
          <span class="common">适合</span>
          <span class="common1">优惠</span>
          <span class="common">政策</span>
        </div>
      </div>
    </div>
    <div class="discount2 discount">
      <div class="content">
        <div class="container">
          <div
            class="fl fadeInLeft animated-fast"
            data-animate-effect="fadeInLeft"
          >
            <img
              src="../assets/imgs/nrong12_04.jpg"
              alt=""
            >
          </div>
          <div
            class="fr fadeInRight animated-fast"
            data-animate-effect="fadeInRight"
          >
            <img
              src="../assets/imgs/neirong21_05.jpg"
              alt=""
            >
          </div>
        </div>
        <div class="centered fadeInUp animated-fast">
          <img
            src="../assets/imgs/neirong21_08.jpg"
            alt=""
          >
        </div>
        <div class="container2">
          <div
            class="fl fadeInLeft animated-fast"
            data-animate-effect="fadeInLeft"
          >
            <img
              src="../assets/imgs/nrong12_07.jpg"
              alt=""
            >
          </div>
          <div
            class="fr fadeInRight animated-fast"
            data-animate-effect="fadeInRight"
          >
            <img
              src="../assets/imgs/neirong21_11.jpg"
              alt=""
            >
          </div>
        </div>
        <div class="triangle">
        </div>
      </div>
    </div>
    <div class="discount3 discount">
      <div class="content">
        <div class="interactive">
          <div
            v-bind:class="{active2_class:tuj_spaeak}"
            class="shishi"
          ></div>
          <div
            v-bind:class="{active3_class:rem_spaeak}"
            class="shiyan"
          ></div>
          <!-- <button class="fl event">热门优惠政策推荐</button> -->
          <button
            @click="show_speak_content('00')"
            v-bind:class="{active_class:tuj_spaeak}"
            class="yanse"
          >热门优惠政策推荐</button>
          <button
            @click="show_speak_content('01')"
            v-bind:class="{active_class:rem_spaeak}"
            class="yan"
          >最新优惠政策</button>
        </div>
        <div
          v-bind:class="{active_class1:tuj_spaeak}"
          class="details"
        >
          <div style="width:1200px;height:490px;padding-top:90px">
            <div style="float: left;width:594px;height:400px">
              <div
                v-for="(item,index) in postData"
                v-if="index<2"
                :key="index"
                class="box1"
              >
                <div class="nrong">
                  <span class="gongtong">已有</span>
                  <span class="dute">{{item.useNum}}</span>
                  <span class="gongtong">户企业查询并满足此项条件</span>
                </div>
                <div class="nrong2">
                  <img
                    style="width:200px;height:200px"
                    :src="item.imageUrl"
                    alt=""
                  >
                </div>
                <div class="nrong3">
                  <p>{{item.projectTitle}}</p>
                </div>
                <div class="shelter">
                  <div class="shiyae wrapper">
                    <div class="xiaohe">
                      <p style="font-size:16px;color:#fefeff">相关文件</p>
                    </div>
                    <div class="xiaohe4">
                      <div class="contrlop">
                        <p
                          class="neirongax"
                          v-for="(ite,inde) in item.policyTitles"
                          :key="inde"
                        >{{ite}}</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div style="float:left;width:594px;height:400px">
              <div
                class="box3"
                v-for="(item,index) in postData"
                v-if="index>=2"
                :key="index"
              >
                <div class="xinxi1">
                  <span class="gongtong">已有</span>
                  <span class="dute">{{item.useNum}}</span>
                  <span class="gongtong">户企业查询并满足此项条件</span>
                </div>
                <div class="xinxi2">
                  <div>
                    <img
                      style="width:60px;height:60px"
                      :src="item.imageUrl"
                      alt=""
                    >
                  </div>
                  <p>{{item.projectTitle}}</p>
                </div>
                <div class="shelter3">
                  <div class="shiyai wrapper">
                    <div class="xiaohe1">
                      <p style="font-size:16px;color:#fefeff">相关文件</p>
                    </div>
                    <div class="xiaohe2">
                      <div class="containers">
                        <p
                          class="neirongax"
                          v-for="(ite,inde) in item.policyTitles"
                          :key="inde"
                        >{{ite}}</p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div
          v-bind:class="{active_class1:rem_spaeak}"
          class="jump"
        >
          <div class="space">
            <div
              v-for="(item,index) in latestData"
              :key="index"
              class="share"
            >
              <img
                src="../assets/imgs/xiaobiaoti_03.jpg"
                alt=""
              >
              <div class="sharespan">
                <p>{{item.projectTitle}}</p>
                <span>【{{item.createTime}}】</span>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="suspension fixed">
        <div class="btn-box">
          <div class="btn-left">
            <span class="btn-white">已为</span>
            <span class="btn-orange">{{settingData.enterpriseNum}}</span>
            <span class="btn-white">个企业提供</span>
            <span class="btn-orange">{{settingData.searchNum}}</span>
            <span class="btn-white">次查询，涉及</span>
            <span class="btn-orange">{{settingData.policyNum}}</span>
            <span class="btn-white">个税收优惠政策</span>
          </div>
          <div class="btn-right">
            <button @click="queryPolicy">查询我适用的优惠政策</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tuj_spaeak: true,
      rem_spaeak: false,
      postData: [],
      latestData: [],
      settingData: {}
    };
  },
  created() {
    this.getHotData() //查询推荐
    this.getNewestData() //查询最新
    this.getSettingInfo() //查询配置项数据
    this.accessRecord('100001','url') //记录访问信息
  },
  computed: {
    userId() {
      return this.$storage.get("taxDiscount")
        ? this.$storage.get("taxDiscount").userId
        : "";
    }
  },
  methods: {
    getHotData() {
      this.$axios
        .post(this.API.discountProjectHome, { type: "00" })
        .then(res => {
          if (res.data.code == 100) {
            this.postData = res.data.data;
          } else {
            // this.$message.error(res.data.mesg)
          }
        })
        .catch(err => {
          // console.log(err);
        });
    },
    getNewestData() {
      this.$axios
        .post(this.API.discountProjectHome, { type: "01" })
        .then(res => {
          if (res.data.code == 100) {
            this.latestData = res.data.data;
          } else {
            // this.$message.error(res.data.mesg)
          }
        })
        .catch(err => {
          // console.log(err);
        });
    },
    show_speak_content(num) {
      switch (num) {
        case "00":
          this.tuj_spaeak = true;
          this.rem_spaeak = false;
          break;
        case "01":
          this.tuj_spaeak = false;
          this.rem_spaeak = true;
          break;
      }
    },
    getSettingInfo() {
      this.$axios
        .post(this.API.querySettingInfo)
        .then(res => {
          if (res.data.code == 100) {
            this.settingData = res.data.data;
          } else {
            // this.$message.error(res.data.mesg)
          }
        })
        .catch(err => {
          // console.log(err);
        });
    },
    queryPolicy() {
      this.accessRecord('100002')
      this.goTo('Layout')
    }
  }
};
</script>


<style  scoped>
.log {
  position: absolute;
  top: 20px;
  width: 120px;
  height: 50px;
  left: 17%;
}
.discount .content {
  width: 1200px;
  margin: 0px auto;
  text-align: center;
}
.discount1 {
  background: url("../assets/imgs/top1_01.jpg") no-repeat center center;
  background-size: 100% 100%;
  height: 550px;
  position: relative;
}
.head {
  margin: 0 auto;
  padding: 95px 0px 0px 134px;
  display: flex;
}
.discount1 .content .head span {
  font-size: 64px;
  color: #ffffff;
  margin-left: 10px;
  line-height: 170px;
}
.common {
  color: #ffffff;
  font-size: 30px;
  line-height: 50px;
}
.common1 {
  color: #fec633;
  font-size: 38px;
}
.title {
  display: flex;
  margin-left: 230px;
  margin-top: 65px;
}
.title2 {
  margin-top: 18px;
  margin-left: 70px;
}
.discount2 {
  background: url("../assets/imgs/beijing1_02.jpg") no-repeat center center;
  background-size: 100% 100%;
  height: 580px;
  position: relative;
  margin-top: -1px;
}
.discount2 .content {
  width: 1200px;
  margin: 0px auto;
  text-align: center;
  padding-top: 170px;
}
.discount2 .content .container .fl img {
  padding-left: 128px;
}
.discount2 .content .container .fr img {
  padding-right: 128px;
}
.discount2 .content .container2 .fl img {
  padding-left: 128px;
}
.discount2 .content .container2 .fr img {
  padding-right: 128px;
}
.container {
  width: 1200px;
  height: 92px;
}
.container2 {
  width: 1200px;
  height: 92px;
}
.fl {
  float: left;
}
.fr {
  float: right;
}
.discount3 {
  background-color: #9999ff;
  height: 930px;
}
.discount3 .content .interactive {
  display: flex;
  justify-content: center;
  position: relative;
  top: 30px;
  padding-top: 96px;
  z-index: 5;
}
.yanse {
  width: 160px;
  border: 0 solid #fff;
  height: 60px;
  font-size: 16px;
  color: #465aeb;
  background: #c5ccff;
  cursor: pointer;
}
.yan {
  width: 160px;
  border: 0 solid #fff;
  height: 60px;
  font-size: 16px;
  color: #465aeb;
  background: #c5ccff;
  cursor: pointer;
}
.discount3 .content .interactive button.event {
  width: 160px;
  background: #465aeb;
  border: 0 solid #fff;
  height: 60px;
  font-size: 16px;
  color: #ffffff;
  cursor: pointer;
}
.shishi {
  width: 0;
  height: 0;
  border-width: 30px;
  position: absolute;
  left: 380px;
  border-style: solid;
  opacity: 0.5;
  border-color: transparent #c5ccff transparent transparent;
}
.shiyan {
  width: 0;
  height: 0;
  border-width: 30px;
  position: absolute;
  right: 380px;
  border-style: solid;
  opacity: 0.5;
  border-color: transparent transparent transparent #c5ccff;
}
.details {
  overflow: hidden;
  width: 1200px;
  height: 580px;
  background-color: #ffffff;
  border-radius: 5px;
  float: left;
  z-index: -1;
  position: absolute;
}
.box1 {
  width: 287px;
  height: 400px;
  margin-left: 10px;
  float: left;
  box-shadow: 1px 1px 2px 2px #f6f6f6;
  border-radius: 5px;
  position: relative;
}
.box1 .nrong {
  margin-top: 58px;
}
.box2 {
  width: 287px;
  height: 400px;
  margin-top: 90px;
  margin-left: 10px;
  float: left;
  box-shadow: 1px 1px 2px 2px #f6f6f6;
  border-radius: 5px;
  position: relative;
}
.box2 .nrong {
  margin-top: 58px;
}
.gongtong {
  color: #5c5858;
  font-size: 14px;
}
.nrong2 {
  margin-top: 30px;
}
.nrong3 {
  margin-top: 30px;
}
.nrong3 p{
  font-size: 15px;
  color: #465aeb;
  overflow:hidden;
  text-align: left;
  display: inline-block;
  padding: 0 20px;
}
.dute {
  color: #fb8f68;
  font-size: 17px;
}
.box3 {
  width: 287px;
  height: 194px;
  margin-left: 10px;
  border-radius: 5px;
  float: left;
  position: relative;
  box-shadow: 1px 1px 2px 2px #f6f6f6;
}
.xinxi1 {
  margin-top: 60px;
}
.xinxi2 {
  margin-top: 20px;
  display: flex;
}
.xinxi2 img {
  margin-left: 30px;
}
.xinxi2 p{
  font-size: 15px;
  color: #465aeb;
  padding: 0 10px;
  text-align: left;
  display: inline-block;
}
.shelter {
  position: absolute;
  top: 0;
}
.shiyae {
  position: absolute;
  top: 0;
  width: 287px;
  height: 400px;
  display: none;
  border-radius: 5px;
  background: rgba(35, 35, 35, 0.8);
}
.shiyai {
  position: absolute;
  top: 0;
  width: 287px;
  height: 194px;
  display: none;
  border-radius: 5px;
  background: rgba(35, 35, 35, 0.8);
}
.box1:hover .shiyae {
  display: block;
}
.box3:hover .shiyai {
  display: block;
}
.shelter3 {
  position: absolute;
  top: 0;
}
.neirongax {
  font-size: 14px;
  margin-top: 24px;
  color: #fefeff;
  text-align: left;
  /* overflow: hidden;
  text-overflow: ellipsis; */
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
.xiaohe {
  width: 232px;
  margin: 0 auto;
  text-align: left;
  margin-top: 58px;
}
.xiaohe1 {
  width: 232px;
  margin: 0 auto;
  text-align: left;
  margin-top: 28px;
}
.xiaohe3 {
  width: 232px;
  margin: 0 auto;
  text-align: left;
  margin-top: 20px;
}
.xiaohe4{
  width: 232px;
  height: 300px;
  margin: 0 auto;
  overflow: hidden;
}
.xiaohe2{
  overflow: hidden;
  width: 232px; 
  margin: 0 auto;
}
.jump {
  width: 1200px;
  height: 580px;
  background-color: #ffffff;
  border-radius: 5px;
  position: absolute;
  z-index: -1;
}
.space {
  width: 880px;
  height: 580px;
  margin: 0 auto;
  padding-top: 70px;
}
.sharespan {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.sharespan p {
  margin-left: 30px;
  font-size: 16px;
  color: #465aeb;
}
.sharespan span {
  font-size: 14px;
  color: #666666;
}
.suspension {
  width: 100%;
  height: 80px;
  background: rgba(35, 35, 35, 0.6);
}
.btn-box {
  line-height: 80px;
  width: 1200px;
  height: 80px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.btn-left {
  padding-left: 45px;
}
.btn-right {
  padding-right: 80px;
}
.btn-right button:hover {
  background: #f5a201;
}
.btn-left .btn-white {
  font-size: 16px;
  color: #ffffff;
}
.btn-left .btn-orange {
  font-size: 18px;
  color: #ffb900;
}
.btn-right button {
  width: 240px;
  height: 40px;
  line-height: 40px;
  background: #ffb900;
  border: 0 solid #fff;
  font-size: 16px;
  color: #333333;
  cursor: pointer;
  border-radius: 25px;
}
.fixed {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10;
}
.active_class {
  background: #465aeb;
  color: #c5ccff;
}
.active_class1 {
  z-index: 1 !important;
}
.active2_class {
  border-color: transparent #465aeb transparent transparent;
}
.active3_class {
  border-color: transparent transparent transparent #465aeb;
}
.animated-fast {
  -webkit-animation-duration: 1.5s;
  animation-duration: 1.5s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

.fadeInUp {
  -webkit-animation-name: fadeInUp;
  animation-name: fadeInUp;
}

.fadeInLeft {
  -webkit-animation-name: fadeInLeft;
  animation-name: fadeInLeft;
}

.fadeInRight {
  -webkit-animation-name: fadeInRight;
  animation-name: fadeInRight;
}

.containers{
  overflow-x: hidden;
  overflow-y: scroll;
  width: 252px;
  height: 120px;
}
.contrlop{
  overflow-x: hidden;
  overflow-y: scroll;
  width: 252px;
  height: 300px;
}

@-webkit-keyframes fadeInUp {
  from {
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translate3d(0, 2000px, 0);
    transform: translate3d(0, 2000px, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translate3d(0, 2000px, 0);
    transform: translate3d(0, 2000px, 0);
  }
  to {
    visibility: visible;
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@-webkit-keyframes fadeInLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-1500px, 0, 0);
    transform: translate3d(-1500px, 0, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-1500px, 0, 0);
    transform: translate3d(-1500px, 0, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@-webkit-keyframes fadeInRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(50px, 0, 0);
    transform: translate3d(50px, 0, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(50px, 0, 0);
    transform: translate3d(50px, 0, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: none;
    transform: none;
  }
}
/* //渐变动画 */
@keyframes fade-in {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 0.1;
  }
  20% {
    opacity: 0.2;
  }
  30% {
    opacity: 0.3;
  }
  40% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.5;
  }
  60% {
    opacity: 0.6;
  }
  70% {
    opacity: 0.7;
  }
  80% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
  }
}
@-webkit-keyframes fade-in {
  /*针对webkit内核*/
  0% {
    opacity: 0;
  }
  10% {
    opacity: 0.1;
  }
  20% {
    opacity: 0.2;
  }
  30% {
    opacity: 0.3;
  }
  40% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.5;
  }
  60% {
    opacity: 0.6;
  }
  70% {
    opacity: 0.7;
  }
  80% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
  }
}
.wrapper {
  animation: fade-in; /*动画名称*/
  animation-duration: 0.3s; /*动画持续时间*/
  -webkit-animation: fade-in 0.3s; /*针对webkit内核*/
}
</style>

